import java.util.Scanner;

import com.liveHere.www.servlet.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("----------------Welcome to LiveHere---------------");
            System.out.println("1. 我是用户");
            System.out.println("2. 我是商户");
            System.out.println("3. 我是管理员");
            System.out.println("4. 退出");
            System.out.print("\n请选择登录类型：");

            int choice = scanner.nextInt();
            scanner.nextLine(); // 清除缓冲区

            switch (choice) {
                case 1:
                    System.out.println("进入用户登录界面...");
                    UserServlet userServlet = new UserServlet();
                    userServlet.start();
                    break;
                case 2:
                    System.out.println("进入商户登录界面...");
                    MerchantServlet merchantServlet = new MerchantServlet();
                    merchantServlet.start();
                    break;
                case 3:
                    System.out.println("进入管理员登录界面。。。");
                    AdminServlet adminServlet = new AdminServlet();
                    adminServlet.start();
                    break;
                case 4:
                    System.out.println("退出系统");
                    return;
                default:
                    System.out.println("无效输入，请重新选择");
            }
        }
    }

}
